Skip to content

Quiet log findings resolve again: the log analyzer may use the log reader - #511

Merged
nambok merged 2 commits into
mainfrom
quiet-findings-resolve
Nov 7, 2026
Merged

nambok merged 2 commits into
mainfrom
quiet-findings-resolve

Conversation

@nambok

@nambok nambok commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

On a self-host install in the same AWS account as the logs it reads, the permissions boundary refused the log analyzer sts:AssumeRole on CoderHelmLogReader (explicit deny in the boundary). Every analyzer run failed, so no finding was refreshed or resolved, while the page kept promising a resolve date that had already passed. This lets the analyzer read logs again, makes the page's date the sweep's date, and says plainly when checks are failing.

Changes

  • Boundary (infra/lib/access.ts): the read-role exception now admits the log analyzer's tag (coderhelm:role=log-analyzer, set in log-analyzer-stack.ts) alongside the gateway and worker, in the same single statement so the boundary stays under IAM's 6,144 characters. The analyzer's own role policy allows sts:AssumeRole on CoderHelmLogReader only, so it still can't take on the data-source role.
  • Access check (selfhost/check-access.mjs): the analyzer's role must carry the tag, and the policy simulator, run on its real role, must deny it CoderhelmReadOnly.
  • IAM simulator fixtures: boundary and runtime verdicts regenerated with deploy-role-sim.py (and --native, whose script now resolves a parameter that points at a parent role). The CloudFormation call rows are unchanged. AWS's registry has since added dynamodb:DescribeBulkOperation and other handler actions, which the simulator doesn't know yet; that drift is left for its own change.
  • One quiet-period rule (common::log_findings::quiet_days_for): the page works the resolve date out from the same inputs as the analyzer's lifecycle.quiet_days_for (daily lines, last resolve, reopen), not a stored quiet_days that was missing or stale (it showed 3 days where the sweep uses 8). Both are checked against services/common/tests/fixtures/quiet_days_cases.json.
  • A passed date is never a promise: resolve_state gives scheduled, due (the next check resolves it) or blocked (checks have failed since X, with the cause in plain words). GET /api/log-findings adds resolve to each finding and analysis_failing per account.
  • Analyzer: a failed query holds only the log groups it covered, so quiet findings elsewhere still resolve. parse_ts reads nanosecond times on Python 3.12.

Verification

  • infra: npm test, 145 of 145 pass (boundary size, own-account roles, simulator fixtures).
  • selfhost: node --test launch/check-access.test.mjs, 12 of 12, including a new case where an analyzer role that may take on the data-source role fails.
  • lambda: python3 -m unittest discover -s lambda/tests, 381 pass. New tests: the shared cases, the incident (an acknowledged finding that came back resolves 8 days after its last line, not 3), and a failing query holding only its groups.
  • Rust: cargo fmt, cargo clippy -p common -p gateway --all-targets -D warnings clean; cargo test -p common log_findings 28 pass and -p gateway log_findings 6 pass. New tests cover the shared cases, a stale stored value, and scheduled, due and blocked states.
  • Production evidence (read-only): the analyzer logged AccessDenied ... explicit deny in a permissions boundary every 6 hours since its last good run; 18 open findings, none resolved since.

…ader

On an install in the same account as the logs it reads, the permissions
boundary let only the gateway and worker take on CoderHelmLogReader. The log
analyzer, its main user, was refused (AccessDenied in a permissions
boundary) on every run, so no finding was refreshed or resolved, and the
page kept promising a resolve date that had passed.

- Boundary: the log analyzer's role (now tagged coderhelm:role=log-analyzer)
  may take on the read roles here; its own role policy keeps it to the log
  reader. One statement, so the boundary stays under IAM's size limit. IAM
  simulator fixtures regenerated for the boundary and runtime verdicts; the
  access check verifies the analyzer's real role can't take on the
  data-source role.
- One quiet-period rule: the page's resolve date is worked out exactly as
  the sweep does (quiet_days_for in Rust and Python, checked against shared
  cases), instead of a stored value that was missing or stale.
- A passed date is never a promise: the page says the next check resolves
  it, or that checks are failing and why, with a banner per account.
- A query that fails holds only the log groups it covered; quiet findings
  in the other groups still resolve.
- The analyzer reads nanosecond times on every Python version.
- The native simulator script resolves a parameter that points at a parent
  role.
@nambok
nambok merged commit 538494f into main Nov 7, 2026
10 checks passed
@nambok
nambok deleted the quiet-findings-resolve branch November 7, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant